home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 2.iso / dist / fw_libglade.idb / usr / freeware / include / glade / glade-widget-tree.h.z / glade-widget-tree.h
C/C++ Source or Header  |  2001-04-12  |  3KB  |  108 lines

  1. /* -*- Mode: C; c-basic-offset: 4 -*-
  2.  * libglade - a library for building interfaces from XML files at runtime
  3.  * Copyright (C) 1998-2001  James Henstridge <james@daa.com.au>
  4.  *
  5.  * glade-widget-tree.h: internal representation of glade files.
  6.  *
  7.  * This library is free software; you can redistribute it and/or
  8.  * modify it under the terms of the GNU Library General Public
  9.  * License as published by the Free Software Foundation; either
  10.  * version 2 of the License, or (at your option) any later version.
  11.  *
  12.  * This library is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15.  * Library General Public License for more details.
  16.  *
  17.  * You should have received a copy of the GNU Library General Public
  18.  * License along with this library; if not, write to the 
  19.  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  20.  * Boston, MA  02111-1307, USA.
  21.  */
  22.  
  23. #ifndef GLADE_WIDGET_TREE_H
  24. #define GLADE_WIDGET_TREE_H
  25.  
  26. #include <gtk/gtk.h>
  27.  
  28. typedef struct _GladeAttribute GladeAttribute;
  29. struct _GladeAttribute {
  30.     gchar *name;
  31.     gchar *value;
  32. };
  33.  
  34. typedef struct _GladeAcceleratorInfo GladeAcceleratorInfo;
  35. struct _GladeAcceleratorInfo {
  36.     guint key;
  37.     GdkModifierType modifiers;
  38.     gchar *signal;
  39. };
  40.  
  41. typedef struct _GladeSignalInfo GladeSignalInfo;
  42. struct _GladeSignalInfo {
  43.     gchar *name;
  44.     gchar *handler;
  45.     gchar *data;
  46.     gchar *object; /* NULL if this isn't a connect_object signal */
  47.     gboolean after : 1;
  48. };
  49.  
  50. typedef struct _GladeStyleInfo GladeStyleInfo;
  51. struct _GladeStyleInfo {
  52.     gchar *name;
  53.     gchar *rc_name;
  54.     gboolean local : 1;
  55. };
  56.  
  57. typedef struct _GladeWidgetInfo GladeWidgetInfo;
  58. struct _GladeWidgetInfo {
  59.     GladeWidgetInfo *parent;
  60.  
  61.     gchar *class;
  62.     gchar *name;
  63.     gchar *tooltip;
  64.  
  65.     gint width, height;
  66.     gint border_width;
  67.  
  68.     /* bit field */
  69.     gboolean visible : 1;
  70.     gboolean sensitive : 1;
  71.     gboolean can_default : 1;
  72.     gboolean can_focus : 1;
  73.     gboolean has_default : 1;
  74.     gboolean has_focus : 1;
  75.  
  76.     GladeStyleInfo *style;
  77.  
  78.     /* lists of GladeAttribute's */
  79.     GList *attributes;
  80.     GList *child_attributes; /* for the <child></child> section */
  81.  
  82.     GList *signals;
  83.     GList *accelerators;
  84.  
  85.     GList *children;
  86. };
  87.  
  88. typedef struct _GladeWidgetTree GladeWidgetTree;
  89. struct _GladeWidgetTree {
  90.     guint ref;
  91.     GTime mtime;
  92.     GList *styles;
  93.     GList *widgets;
  94.     GHashTable *names;
  95. };
  96.  
  97. /* parse a file and create a GladeWidgetTree structure */
  98. GladeWidgetTree *glade_widget_tree_parse_file(const char *file);
  99. /* parse a buffer and create a GladeWidgetTree structure */
  100. GladeWidgetTree *glade_widget_tree_parse_memory(char *buffer, int size);
  101. /* ref/unref a GladeWidgetTree structure*/
  102. GladeWidgetTree *glade_widget_tree_ref(GladeWidgetTree *tree);
  103. void glade_widget_tree_unref(GladeWidgetTree *tree);
  104. /* print the info stored in a GladeWidgetTree structure */
  105. void glade_widget_tree_print(GladeWidgetTree *tree);
  106.  
  107. #endif
  108.